package com.cus.tom.transfer.ac;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;

import com.cus.tom.elec.utils.AdUtil;
import com.cus.tom.transfer.BuildConfig;
import com.cus.tom.transfer.utils.Utils;
import com.plata.base.base.AbsBaseActivity;
import com.plata.base.utils.WeakHandler;

import me.jessyan.autosize.internal.CancelAdapt;

public class BaseAct extends AbsBaseActivity implements CancelAdapt {

    protected final WeakHandler h = new WeakHandler();

    @Override
    public void setContentView(View view) {
        super.setContentView(view);
        if (paddingTop()) {
            view.setPadding(0, Utils.getStatusBarHeight(this), 0, 0);
        }
    }

    protected boolean paddingTop() {
        return true;
    }


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AdUtil.Companion.adInsert(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        h.removeCallbacksAndMessages(null);
    }

    @Override
    public void sendBroadcast(Intent intent) {
        intent.setPackage(BuildConfig.APPLICATION_ID);
        super.sendBroadcast(intent);
    }
}
